home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / PRGMANIA / VERSION1.5 / GEMFORM.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-27  |  35.4 KB  |  1,098 lines

  1. /*************************************************************************
  2.  *  GemForm.C : Fonctions de gestion des formulaires en fenetre.         *
  3.  *************************************************************************/
  4. #include "WindGem.h"
  5. #include "winproto.h"
  6. #include <unistd.h>
  7.  
  8. /* Fonctions privees, internes a gemform */
  9. static void WindFormDo(Wind *wind, int evnt);
  10. static int do_keybd(OBJECT *tree, int objc);
  11. static void gere_boutons(void);
  12. static void gere_clavier(void);
  13. static void EvntSpe (int *evnt);
  14.  
  15. /*-----------------------------------------------------------------------*
  16.  * Initialisation des fenetres formulaires.                              *
  17.  *                                                                       *
  18.  * numObj     : index de l'objet a mettre en fenetre                     *
  19.  * inf_x      : position X de la fenetre au depart                       *
  20.  * inf_y      : position Y de la fenetre au depart                       *
  21.  * title      : titre du formulaire                                      *
  22.  * edit       : numero du 1er champ editable                             *
  23.  * fonct      : fonction de gestion du formulaire                        *
  24.  *                                                                       *
  25.  * Derniere modification : 25/04/1996                                    *
  26.  *-----------------------------------------------------------------------*/
  27. void WindFormInit(int numObj, int mode, int inf_x, int inf_y, char *title, int edit, void (*fonct)(int evnt))
  28. {
  29.     OBJECT *adrForm;
  30.     int offset = 0, inf_flag = 0;
  31.     int wx, wy, ww, wh;
  32.     GRECT pos;
  33.     WindForm *ptr_dial = (WindForm *)malloc(sizeof(WindForm));
  34.  
  35.     rsrc_gaddr(R_TREE, numObj, &adrForm);
  36.     ptr_dial->adr_form = adrForm;
  37.     if (adrForm->ob_state & OUTLINED)    /* Ce decalage est invariable !!! */
  38.         ptr_dial->offset = offset = 3;
  39.     else
  40.     {
  41.         if (global[1] > 1) /* Si Multitache */
  42.             ptr_dial->offset = 1; /* surtout pour Magic 4 */
  43.         else
  44.             ptr_dial->offset = 0;
  45.     }        
  46.  
  47.     form_center(adrForm, &wx, &wy, &ww, &wh);
  48.     wind_calc(WC_BORDER, FW_ATTRIB, wx, wy, ww, wh, &wx, &wy, &ww, &wh);
  49.     if (inf_x != 0 || inf_y != 0)
  50.     {    /* si valeurs lues dans fichier .INF ... */
  51.         wx = inf_x; wy = inf_y;
  52.         inf_flag = TRUE;
  53.     }
  54.     pos.g_x = wx;
  55.     pos.g_y = wy;
  56.     pos.g_w = ww;
  57.     pos.g_h = wh;
  58.     ptr_dial->edit            = edit;
  59.     ptr_dial->edit_objc = edit;
  60.     ptr_dial->edit_pos     = 0;
  61.     /* Gestion de l'aide en ligne */
  62.     ptr_dial->aide            = (AIDE *)NULL;
  63.     ptr_dial->popup            = (POPUP *)NULL;
  64.     ptr_dial->fonct            = fonct;
  65.     
  66.     if (inf_flag)
  67.     {    /* ... alors recaler le formulaire sur la fenetre. */
  68.         wind_calc(WC_WORK, FW_ATTRIB, wx, wy, ww, wh, &wx, &wy, &ww, &wh);
  69.         adrForm->ob_x = wx + offset;
  70.         adrForm->ob_y = wy + offset;
  71.     }
  72.     set_user(adrForm);                            /* Etablissement des boutons USERDEFS. */
  73.     
  74.     AjouteListe (WTYPFORM, mode == WNORM ? FW_ATTRIB : MD_ATTRIB, numObj, mode, title, pos, (void *)ptr_dial);
  75. }
  76.  
  77. /*-----------------------------------------------------------------------*
  78.  * Ouverture d'une fenetre.                                              *
  79.  *                                                                       *
  80.  * numObj            : numero de l'objet a afficher.                            *
  81.  *                                                                       *
  82.  * Derniere modification : 25/04/1996                                    *
  83.  *-----------------------------------------------------------------------*/
  84. void WindOpen(int numObj)
  85. {
  86.     int attrib;
  87.     Wind *wind;
  88.     OBJECT *ptr_objc;
  89.     WindForm *ptr_dial;
  90.     WindUser *ptr_user;
  91.  
  92.     wind = ObjListe(numObj);
  93.  
  94.     attrib = wind->attrib;
  95.  
  96.     if (wind->handle != BLANK)
  97.         wind_set(wind->handle, WF_TOP);
  98.     else
  99.     {
  100.         if ((wind->handle = wind_create(attrib, wind->Xpos, wind->Ypos, wind->Wpos, wind->Hpos)) != 0)
  101.         {
  102.             wind_set(wind->handle, WF_NAME, wind->w_title);
  103.             graf_growbox(0, 0, 0, 0, wind->Xpos, wind->Ypos, wind->Wpos, wind->Hpos);
  104.             wind_open(wind->handle, wind->Xpos, wind->Ypos, wind->Wpos, wind->Hpos);
  105.  
  106.             switch(wind->type)
  107.             {
  108.                 case WTYPFORM :
  109.                     ptr_dial = wind->cont.dialog;
  110.                     ptr_dial->edit_objc = ptr_dial->edit;
  111.                     ptr_objc = &(ptr_dial->adr_form[ptr_dial->edit]);
  112.                     if ((ptr_objc->ob_flags & EDITABLE) != 0)
  113.                         ptr_dial->edit_pos = (int)strlen((ptr_objc->ob_spec.tedinfo)->te_ptext);
  114.                     /* Envoi de l'evenement OPEN a la fenetre */
  115.                     (*ptr_dial->fonct)(EV_OPEN);
  116.                     break;
  117.                 case WTYPTEXT :
  118.                     WindTextSliders (wind);
  119.                     break;
  120.                 case WTYPUSER :
  121.                     ptr_user = wind->cont.user;
  122.                     if (ptr_user->init)
  123.                         (*ptr_user->init)();
  124.                     break;
  125.             }
  126.             /* Si fenetre modale, on bloque les evenements MU_MESSAG */
  127.             if (wind->mode == WMODAL)
  128.             {
  129.                 register int index = 3;
  130.                 
  131.                 Sys->lastMode = WMODAL;
  132.                 while (AdrMenu[index++].ob_type == G_TITLE)
  133.                     AdrMenu[index].ob_state |= DISABLED;
  134.                 while(AdrMenu[index].ob_type != G_STRING)
  135.                     index++;
  136.                 AdrMenu[index].ob_state |= DISABLED;
  137.               menu_bar (AdrMenu, 1);
  138.             }
  139.         }
  140.         else
  141.             form_alert(1, ErrMessageNoWind);
  142.     }
  143. }
  144.  
  145. /*-----------------------------------------------------------------------*
  146.  * Fermeture d'une fenetre.                                              *
  147.  *                                                                       *
  148.  * numObj  : Numero de la fenetre                                        *
  149.  *                                                                       *
  150.  * Derniere modification : 25/04/1996                                    *
  151.  *-----------------------------------------------------------------------*/
  152. void WindClose(int numObj)
  153. {
  154.     Wind *wind;
  155.  
  156.     wind = ObjListe(numObj);
  157.  
  158.     /* Si fenetre modale, on reautorise les evenements MU_MESSAG */
  159.     if (wind->mode == WMODAL)
  160.     {
  161.         register int index = 3;
  162.         Sys->lastMode = WNORM;
  163.         while (AdrMenu[index++].ob_type == G_TITLE)
  164.             AdrMenu[index].ob_state &= ~DISABLED;
  165.         while(AdrMenu[index].ob_type != G_STRING)
  166.             index++;
  167.         AdrMenu[index].ob_state &= ~DISABLED;
  168.       menu_bar (AdrMenu, 1);
  169.     }
  170.     wind_close(wind->handle);
  171.     wind_delete(wind->handle);
  172.     graf_shrinkbox(0, 0, 0, 0, wind->Xpos, wind->Ypos, wind->Wpos, wind->Hpos);
  173.     wind->handle     = BLANK;
  174. }
  175.  
  176. /*-----------------------------------------------------------------------*
  177.  * Destruction d'une fenetre.                                            *
  178.  *                                                                       *
  179.  * numObj  : Numero de la fenetre                                        *
  180.  *                                                                       *
  181.  * Derniere modification : 26/12/1996 : Correction                       *
  182.  *-----------------------------------------------------------------------*/
  183. void WindDelete(int numObj)
  184. {
  185.     Wind *wind;
  186.  
  187.     wind = ObjListe(numObj);
  188.  
  189.     /* Si fenetre ouverte, on la ferme */
  190.     if (wind->handle > 0)
  191.     {
  192.         wind_close(wind->handle);
  193.         wind_delete(wind->handle);
  194.         graf_shrinkbox(0, 0, 0, 0, wind->Xpos, wind->Ypos, wind->Wpos, wind->Hpos);
  195.     }
  196.  
  197.     /* Si menu ou ToolBar en fenêtre, libérer mémoire utilisée */
  198.     if (wind->adr_wmenu != (OBJECT *)NULL)
  199.         free(wind->adr_wmenu);
  200.     if (wind->adr_wtoolbar != (OBJECT *)NULL)    /* Un oubli ! */
  201.         free(wind->adr_wtoolbar);
  202.  
  203.     if (wind->type == WTYPFORM)
  204.     {
  205.         register WindForm *ptr_dial = wind->cont.dialog;
  206.         register AIDE *aide = ptr_dial->aide, *tmp;
  207.         register POPUP *popup = ptr_dial->popup, *tmp1;
  208.  
  209.         while (aide != (AIDE *)NULL)        
  210.         {
  211.             tmp = aide;
  212.             aide = aide->suiv;
  213.             free (tmp->txt);
  214.             free (tmp);
  215.         }
  216.         while (popup != (POPUP *)NULL)
  217.         {
  218.             tmp1 = popup;
  219.             popup = popup->suiv;
  220.             free (tmp1);
  221.         }
  222.         free (wind->cont.dialog);
  223.     }
  224.     else if (wind->type == WTYPTEXT)
  225.     {
  226.         register WindText *ptr_txt = wind->cont.text;
  227.  
  228.         if (ptr_txt->type == TYP_TEXT_AUTO)    /* Si texte venant d'un fichier  */
  229.             free (ptr_txt->lignes);                        /* uniquement !!                 */
  230.         free (wind->cont.text);
  231.     }
  232.     else
  233.         free(wind->cont.user);
  234.  
  235.     wind->handle     = BLANK;
  236.     wind->numObj    = BLANK;
  237.     wind->attrib    = ZERO;
  238.     wind->mode        = WNORM;
  239.     wind->type         = WTYPNONE;
  240.     free (wind->w_title);
  241. }
  242.  
  243. /*************************************************************************
  244.  * fonctions de gestion des evenements                                   *
  245.  *************************************************************************/
  246.  
  247. /*-----------------------------------------------------------------------*
  248.  * Fonction de redessin d'un objet d'un formulaire en fenêtre.           *
  249.  *                                                                       *
  250.  * arbre     : numéro de l'arbre d'objets                                   *
  251.  * objet  : objet à redessinner                                          *
  252.  *                                                                       *
  253.  * Auteur : G oublié...argh ! (mais c pas moi)                           *
  254.  * Derniere modification : 25/04/1996                                    *
  255.  *-----------------------------------------------------------------------*/
  256. void WindDraw(int arbre, int objet)
  257. {
  258.     Wind *wind;
  259.     WindForm *ptr_form;
  260.     GRECT r;
  261.     int dummy, top;
  262.   
  263.   wind = ObjListe(arbre);
  264.   ptr_form = wind->cont.dialog;
  265.   
  266.   if ( wind->handle > 0)  /* la fenetre existe ? */
  267.   {
  268.     wind_update(BEG_UPDATE);
  269.     wind_get(0, WF_TOP, &top, &dummy, &dummy, &dummy);
  270.     if ( wind->handle == top) /* si topped, on optimise... */        
  271.       objc_draw(ptr_form->adr_form, objet, MAX_DEPTH, wind->Xpos,
  272.         wind->Ypos, wind->Wpos,wind->Hpos);
  273.         
  274.     else
  275.     {
  276.         wind_get(wind->handle, WF_FIRSTXYWH, &r.g_x, &r.g_y, &r.g_w, &r.g_h);
  277.       while (r.g_w && r.g_h)
  278.       {
  279.         objc_draw(ptr_form->adr_form, objet, MAX_DEPTH, r.g_x, r.g_y, r.g_w, r.g_h);
  280.             wind_get(wind->handle, WF_NEXTXYWH, &r.g_x, &r.g_y, &r.g_w, &r.g_h);
  281.       }
  282.     }
  283.     wind_update(END_UPDATE);
  284.   }
  285. }
  286.  
  287. /*-----------------------------------------------------------------------*
  288.  * Fonction de gestion des formulaires en fenetre                        *
  289.  *                                                                       *
  290.  * wind     : objet Wind a traiter                                         *
  291.  * event  : evenement a traiter                                          *
  292.  *                                                                       *
  293.  * Derniere modification : 21/04/1996                                    *
  294.  *-----------------------------------------------------------------------*/
  295. static void WindFormDo(Wind *wind, int evnt)
  296. {
  297.     GRECT r, rd;
  298.     int wx, wy, ww, wh;
  299.     register int dialog = TRUE, init_field = FALSE;
  300.     register WindForm *ptr_dial = wind->cont.dialog;
  301.     
  302.     if ((evnt > 0) && (evnt & MU_MESAG))
  303.     {
  304.         switch(buff[0])
  305.         {
  306.             case WM_REDRAW :
  307.                 rd.g_x = buff[4]; rd.g_y = buff[5];
  308.                 rd.g_w = buff[6]; rd.g_h = buff[7];
  309.                 if (wind->iconified == TRUE)
  310.                     DrawIcone (wind->handle, &rd);
  311.                 else
  312.                 {
  313.                     if (ptr_dial->edit_objc)
  314.                     {    /* si champ editable et...*/
  315.                         wind_get(0, WF_TOP, &wx, &wy, &ww, &wh);
  316.                         if (wind->handle == wx)
  317.                         { /*...si fenetre au 1° plan -> redessin total */
  318.                             wind_get(wind->handle, WF_WORKXYWH, &rd.g_x, &rd.g_y, &rd.g_w, &rd.g_h);
  319.                             init_field = EDEND;
  320.                         }
  321.                     }
  322.                     wind_update(BEG_UPDATE);
  323.                     wind_get(wind->handle, WF_FIRSTXYWH, &r.g_x, &r.g_y, &r.g_w, &r.g_h);
  324.                     while (r.g_w && r.g_h)
  325.                     {
  326.                 /* On commence par afficher la barre de menu s'il y en a une */
  327.                         if (wind->adr_wmenu != (OBJECT *)NULL)
  328.                     objc_draw (wind->adr_wmenu, BARMENU, MAX_DEPTH, r.g_x, r.g_y, r.g_w, r.g_h);
  329.                         if (wind->adr_wtoolbar != (OBJECT *)NULL)
  330.                     objc_draw (wind->adr_wtoolbar, ROOT, MAX_DEPTH, r.g_x, r.g_y, r.g_w, r.g_h);
  331.  
  332.                         if (rc_intersect(&rd, &r))
  333.                             objc_draw(ptr_dial->adr_form, 0, 8, r.g_x, r.g_y, r.g_w, r.g_h);
  334.                         wind_get(wind->handle, WF_NEXTXYWH, &r.g_x, &r.g_y, &r.g_w, &r.g_h);
  335.                     }
  336.                     wind_update(END_UPDATE);
  337.                     if (ptr_dial->edit_objc && init_field)
  338.                         objc_edit(ptr_dial->adr_form, ptr_dial->edit_objc, 0, ptr_dial->edit_pos, init_field, &(ptr_dial->edit_pos));
  339.                 }
  340.                 break;
  341.  
  342.             case WM_TOPPED :
  343.                 wind_set(wind->handle, WF_TOP);
  344.                 if (ptr_dial->edit_objc && global[1] > 1)
  345.                 {
  346.                     wind_get(buff[3], WF_WORKXYWH, &wx, &wy, &ww, &wh);
  347.                     form_dial(FMD_FINISH, 0,0,0,0, wx, wy, ww, wh);                
  348.                 }
  349.                 break;
  350.  
  351.             case WM_CLOSED : 
  352.                 /* Envoi de l'evenement fermeture a l'utilisateur pour trtmt */
  353.                 (*ptr_dial->fonct)(EV_CLOSE);
  354.                 WindClose(wind->numObj);
  355.                 break;
  356.  
  357.             case WM_MOVED :
  358.                 wind_set(wind->handle, WF_CURRXYWH, buff[4], buff[5], buff[6], buff[7]);
  359.                 if (wind->iconified == FALSE)
  360.                 {
  361.                     wind->Xpos = buff[4];
  362.                     wind->Ypos = buff[5];
  363.  
  364.                     RecaleWind (wind);
  365.                 }
  366.                 break;
  367.                 
  368.             case WM_ICONIFY :
  369.                 graf_shrinkbox(buff[4], buff[5], buff[6], buff[7], wind->Xpos, wind->Ypos, wind->Wpos, wind->Hpos);
  370.                 wind_set(wind->handle, WF_ICONIFY, buff[4], buff[5], buff[6], buff[7]);
  371.                 wind->iconified = TRUE;
  372.                 break;
  373.                 
  374.             case WM_UNICONIFY :
  375.                 graf_growbox( wind->Xpos, wind->Ypos, wind->Wpos, wind->Hpos, buff[4], buff[5], buff[6], buff[7]);
  376.                 wind_set(wind->handle, WF_UNICONIFY, buff[4], buff[5], buff[6], buff[7]);
  377.                 wind->iconified = FALSE;
  378.                 break;
  379.         }
  380.     }
  381. }
  382.  
  383. /*-----------------------------------------------------------------------*
  384.  * Gestion du clavier.                                                   *
  385.  *                                                                       *
  386.  * tree : arbre d'objet a gerer                                          *
  387.  * objc : numero d'objet dans l'arbre                                    *
  388.  *                                                                       *
  389.  * Derniere modification : 25/04/1996                                    *
  390.  *-----------------------------------------------------------------------*/
  391. static int do_keybd(OBJECT *tree, int objc)
  392. {
  393.     register int index, pos;
  394.     register char *ed_text;
  395.     register OBJECT *ptr_objc;
  396.     int len, dialog, key_short;
  397.     unsigned char dum;
  398.  
  399.     dialog = form_keybd(tree, objc, objc, Sys->key, &(Sys->new_objc), &(Sys->key));
  400.     if (dialog)
  401.     {
  402.         if (Sys->key == 0)
  403.         {
  404.             if (Sys->new_objc != 0)
  405.             {
  406.                 ptr_objc = &tree[Sys->new_objc];
  407.                 Sys->new_pos = (int) strlen((ptr_objc->ob_spec.tedinfo)->te_ptext);
  408.             }
  409.             else
  410.                 Sys->new_pos = 0;
  411.         }
  412.         else
  413.         {
  414.             if (objc)
  415.             {
  416.                 pos = Sys->new_pos;
  417.                 
  418.                 ptr_objc = &tree[objc];
  419.                 ed_text = (ptr_objc->ob_spec.tedinfo)->te_ptext;
  420.                 len = (int) strlen(ed_text);
  421.                 switch (Sys->key)
  422.                 {
  423.                     case 0x7300 :        /* Control <- : Curseur en debut de Champ */
  424.                         pos = 0;
  425.                         Sys->key = 0;
  426.                         break;
  427.                     case 0x7400 :        /* Control -> : Curseur en fin de Champ */
  428.                         pos = len;
  429.                         Sys->key = 0;
  430.                         break;
  431.                     case 0x4b34 :        /* SHIFT <- : Saute un mot    */
  432.                         while (pos)
  433.                         {
  434.                             pos--;
  435.                             if (ed_text[pos] == ' ')
  436.                                 break;
  437.                         }
  438.                         Sys->key = 0;
  439.                         break;
  440.                     case 0x4d36 :        /* SHIFT -> : Saute un mot    */
  441.                         while (pos < len)
  442.                         {
  443.                             pos++;
  444.                             if (ed_text[pos] == ' ')
  445.                                 break;
  446.                         }
  447.                         if (pos < len)
  448.                             pos++;
  449.                         Sys->key = 0;
  450.                         break;
  451.                 }
  452.                 Sys->new_pos = pos;
  453.             }
  454.             if (Sys->key != 0 && Sys->kbd == K_ALT)
  455.             {    /* Raccourcis claviers    */
  456.                 key_short = stdkey(&dum);
  457.                 index = 1;
  458.                 do
  459.                 {
  460.                     ptr_objc = &tree[index]; /* pointe sur l'objet a traiter */
  461.                     ed_text = 0;
  462.                     if (((ptr_objc->ob_state&DISABLED)==0) && ((ptr_objc->ob_type & 0x200) != 0))
  463.                     { /* si l'objet n'est pas desactive    */
  464.                         switch (ptr_objc->ob_type & 0xff)
  465.                         {
  466.                             case G_BUTTON :
  467.                                 ed_text = ptr_objc->ob_spec.free_string;
  468.                                 break;
  469.                             case G_USERDEF :
  470.                                 ed_text = (char *)((ptr_objc->ob_spec.userblk)->ub_parm);
  471.                         }
  472.                         if (ed_text && (ed_text = strchr(ed_text, '[')) != 0)
  473.                         {
  474.                             if (key_short == toupper(ed_text[1]))
  475.                             { /* Simuler un clic sur l'objet et retour : */
  476.                                 Sys->key = 0;
  477.                                 Sys->objet = index;
  478.                                 form_button(tree, index, 1, &(Sys->new_objc));
  479.                                 evnt_timer(100,0);
  480.                                 return -1;
  481.                             }
  482.                         }
  483.                     }
  484.                     index ++; /* Prepare l'objet suivant ... */
  485.                 /* ... sauf si l'objet actuel est le dernier : */
  486.                 } while((ptr_objc->ob_flags & LASTOB) == 0);
  487.             }
  488.         }
  489.     }
  490.     return dialog;
  491. }
  492.  
  493. /*-----------------------------------------------------------------------*
  494.  * Fonction de remplacement du Form_do du GEM.                           *
  495.  *                                                                       *
  496.  * Derniere modification : 26/12/1996 : Nouveau filtre des évt MU_MESSAG *
  497.  *                                      pour gestion des fenêtres modales*
  498.  *-----------------------------------------------------------------------*/
  499. int EventMulti (void)
  500. {
  501.     static int xmouse = 0, ymouse = 0;
  502.     int evnt;                                /* Type d'événement                            */
  503.     int top, dummy;
  504.     Wind *wind;                            /* Pointeur pour element de liste de fenetre   */
  505.     WindForm *ptr_dial;
  506.         
  507.     Sys->objet = ZERO;            /* Mise à zéro avant de commencer              */
  508.  
  509.     while (TRUE)                         /* BOUCLE "SANS FIN"                           */
  510.     { /* Surveillance des événements Clavier, Clic, Message et Timer       */
  511.         evnt = evnt_multi ((MU_MESAG|MU_BUTTON|MU_KEYBD|MU_TIMER),
  512.                                              258, 3, 0,    /* au lieu de 2,1,1 pour gerer les deux boutons */
  513.                                              ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO,
  514.                                              buff, 500, 0,
  515.                                              &(Sys->mousex), &(Sys->mousey), &(Sys->mousek),
  516.                                              &(Sys->kbd), &(Sys->key), &(Sys->clik));
  517.  
  518. /*-----------------------------------------------------------------------*
  519.  * Gestion des evenements Timer.                                         *
  520.  *-----------------------------------------------------------------------*/
  521.         if (evnt & MU_TIMER)
  522.         {
  523.             int mx, my;
  524.             
  525.             graf_mkstate (&mx, &my, &dummy, &dummy);
  526.           if (xmouse == mx && ymouse == my)
  527.           {
  528.                 wind_get (ZERO, WF_TOP, &top, &dummy, &dummy, &dummy);
  529.                 wind = TopListe(top);
  530.  
  531.                 if (wind != WIND_NULL && wind->type == WTYPFORM && NOT wind->iconified)
  532.                 {
  533.                     ptr_dial = wind->cont.dialog;
  534.                     Sys->AdrObjet = ptr_dial->adr_form;
  535.                     Sys->objet = objc_find (Sys->AdrObjet, ROOT, MAX_DEPTH, Sys->mousex, Sys->mousey);
  536.                     AfficheAide (wind, Sys->objet);
  537.                 }
  538.             }
  539.             else
  540.             {
  541.               xmouse = mx;
  542.                  ymouse = my;
  543.             }
  544.         }
  545.     
  546. /*-----------------------------------------------------------------------*
  547.  * Gestion des evenements clavier.                                       *
  548.  *-----------------------------------------------------------------------*/
  549.         if (evnt & MU_KEYBD)            
  550.             gere_clavier();
  551.  
  552. /*-----------------------------------------------------------------------*
  553.  * Gestion des evenements Message                                        *
  554.  *-----------------------------------------------------------------------*/
  555.          if ((evnt & MU_MESAG) && buff[0] == MN_SELECTED && AdrMenu != (OBJECT *)NULL)
  556.         {    /* Appel a la fonction de gestion du menu */
  557.             int opt = buff[3];    /* Nécessaire !! */
  558.  
  559.             (*Sys->menu)(buff[4]);
  560.             menu_tnormal(AdrMenu, opt, 1);
  561.         }
  562.         else if (evnt & MU_MESAG) /* Si événement message */
  563.         {
  564.             /* Recupere fenetre qui a recu le message */
  565.             wind = TopListe(buff[3]);
  566.  
  567.             if (wind != WIND_NULL)
  568.             {
  569.                 /* On ne traite l'événement que si :
  570.                    1 - ce n'est pas un événement TOPPED,
  571.                    2 - OU si on est en fonctionnement MODAL ET que c'est la fenêtre modale
  572.                    3 - OU si on est en fonctionnement MODAL ET que ce n'est pas la fenêtre modale ET que l'événement n'est pas TOPPED
  573.                     Ceci en raison du nouveau système de gestion des fenêtres modales.
  574.                     => On empêche toutes les fenêtres non modales de passer en premier plan.
  575.                 */
  576.                 if (buff[0] != WM_TOPPED || (buff[0] == WM_TOPPED && ((Sys->lastMode == WMODAL && wind->mode == WMODAL) || Sys->lastMode == WNORM)))
  577.                 {
  578.                     CurWindow = wind->numObj;
  579.  
  580.                     switch (wind->type)
  581.                     {
  582.                         case WTYPFORM :
  583.                             WindFormDo(wind, evnt);
  584.                             break;
  585.                         case WTYPTEXT :
  586.                             WindTextDo(wind, evnt);
  587.                             break;
  588.                         case WTYPUSER :
  589.                             WindUserDo (wind, evnt);
  590.                             break;
  591.                     }            
  592.                 }
  593.             }
  594.     }
  595. /*-----------------------------------------------------------------------*
  596.  * Gestion des evenements Bouton                                         *
  597.  *-----------------------------------------------------------------------*/
  598.  
  599.         if (evnt & MU_BUTTON)
  600.         {
  601.             /* Bouton droit == popup menu, sinon traitement normal de l'évnt   */
  602.             if (Sys->mousek == 2 && Sys->popMenu != BLANK)
  603.                 pop_up (BLANK, BLANK, Sys->popMenu);
  604.             else
  605.                 gere_boutons();
  606.         }
  607.  
  608.         return evnt;
  609.     }
  610. }
  611.  
  612. /*-----------------------------------------------------------------------*
  613.  * Deselection d'un objet d'un arbre donne                               *
  614.  *                                                                       *
  615.  * arbre     : Numero de l'arbre d'objets                                  *
  616.  * numObjc : Numero de l'objet                                           *
  617.  *-----------------------------------------------------------------------*/
  618. void ObjcUnselect(int arbre, int numObjc)
  619. {
  620.     Wind *wind;
  621.     WindForm *ptr_form;
  622.     
  623.     /* On recupere les info sur l'arbre d'objet */
  624.     wind = ObjListe(arbre);
  625.     if (wind != WIND_NULL)
  626.     {
  627.         ptr_form = wind->cont.dialog;
  628.         objc_change(ptr_form->adr_form, numObjc, 0, wind->Xpos, wind->Ypos, wind->Wpos, wind->Hpos, 0, TRUE);
  629.     }
  630. }
  631.  
  632. /*-----------------------------------------------------------------------*
  633.  * Initialise l'objet <objet> de l'arbre <arbre> avec <valeur>           *
  634.  *-----------------------------------------------------------------------*/
  635. void SetValeur (int arbre, int objet, char *valeur)
  636. {
  637.     register Wind *wind;
  638.     register WindForm *ptr_dial;
  639.     
  640.     wind = ObjListe(arbre);
  641.     if (wind != WIND_NULL)
  642.     {
  643.         ptr_dial = wind->cont.dialog;
  644.         set_text(ptr_dial->adr_form, objet, valeur);
  645.     }
  646. }
  647.  
  648. /*-----------------------------------------------------------------------*
  649.  * Retourne la valeur de l'objet <objet> de l'arbre <arbre>              *
  650.  *-----------------------------------------------------------------------*/
  651. char *GetValeur (int arbre, int objet)
  652. {
  653.     Wind *wind;
  654.     WindForm *ptr_dial;
  655.     
  656.     wind = ObjListe(arbre);
  657.     if (wind != WIND_NULL)
  658.     {
  659.         ptr_dial = wind->cont.dialog;
  660.         return get_text(ptr_dial->adr_form, objet);
  661.     }
  662.     else
  663.         return (char *)NULL;
  664. }
  665.  
  666. /*-----------------------------------------------------------------------*
  667.  * Renvoie les coordonnées d'une fenêtre                                 *
  668.  *-----------------------------------------------------------------------*/
  669. void GetCoord (int numObj, GRECT *coord)
  670. {
  671.     Wind *wind;
  672.     
  673.     wind = ObjListe(numObj);
  674.     if (wind != WIND_NULL)
  675.     {
  676.         coord->g_x = wind->Xpos;
  677.         coord->g_y = wind->Ypos;
  678.         coord->g_w = wind->Wpos;
  679.         coord->g_h = wind->Hpos;
  680.     }
  681.     else
  682.         coord = (GRECT *)NULL;
  683. }
  684.  
  685. /*-----------------------------------------------------------------------*
  686.  * Retourne le handle associé à une fenêtre quel que soit son type.      *
  687.  *-----------------------------------------------------------------------*/
  688. void GetWorkXYWH (int numObj, GRECT *coord)
  689. {
  690.     Wind *wind;
  691.     
  692.     wind = ObjListe(numObj);
  693.     if (wind != WIND_NULL && wind->handle != BLANK)
  694.     {
  695.         wind_get(wind->handle, WF_WORKXYWH, &(coord->g_x), &(coord->g_y), &(coord->g_w), &(coord->g_h));
  696.         if (wind->adr_wmenu != (OBJECT *)NULL)
  697.         {
  698.             coord->g_y += wind->adr_wmenu[BARTITLE].ob_height + 1;
  699.             coord->g_h -= wind->adr_wmenu[BARTITLE].ob_height + 1;
  700.         }
  701.         if (wind->adr_wtoolbar != (OBJECT *)NULL)
  702.         {
  703.             coord->g_y += wind->adr_wtoolbar[ROOT].ob_height + 2;
  704.             coord->g_h -= wind->adr_wtoolbar[ROOT].ob_height + 2;
  705.         }
  706.         if (wind->adr_wmenu != (OBJECT *)NULL && wind->adr_wtoolbar != (OBJECT *)NULL && global[1] == 1)
  707.         {
  708.             coord->g_y++;
  709.             coord->g_h--;
  710.         }
  711.         else if (wind->adr_wtoolbar != (OBJECT *)NULL && global[1] > 1)
  712.         {
  713.             coord->g_y -= 2;
  714.             coord->g_h += 2;
  715.         }
  716.     }
  717.     else
  718.         coord = (GRECT *)NULL;
  719. }
  720.  
  721. /*-----------------------------------------------------------------------*
  722.  * Retourne un pointeur sur la variable OBJECT associée à <arbre>        *
  723.  *-----------------------------------------------------------------------*/
  724. OBJECT *GetObject (int arbre)
  725. {
  726.     Wind *wind;
  727.     WindForm *ptr_dial;
  728.     
  729.     wind = ObjListe(arbre);
  730.     if (wind != WIND_NULL)
  731.     {
  732.          ptr_dial = wind->cont.dialog;
  733.         return ptr_dial->adr_form;
  734.     }
  735.     else
  736.         return (OBJECT *)NULL;
  737. }
  738.  
  739. /*-----------------------------------------------------------------------*
  740.  * Retourne le handle associé à une fenêtre quel que soit son type.      *
  741.  *-----------------------------------------------------------------------*/
  742. int GetHandle (int objet)
  743. {
  744.     Wind *wind;
  745.     
  746.     wind = ObjListe(objet);
  747.     if (wind != WIND_NULL)
  748.         return wind->handle;
  749.     else
  750.         return BLANK;
  751. }
  752.  
  753. /*-----------------------------------------------------------------------*
  754.  * Retourne le numero de l'objet EXIT qui vient d'etre selectionne       *
  755.  *-----------------------------------------------------------------------*/
  756. int GetObjet(void)
  757. {
  758.     return Sys->objet;
  759. }
  760.  
  761. /*-----------------------------------------------------------------------*
  762.  * Efface le contenu d'un champ d'un arbre d'objet                       *
  763.  *-----------------------------------------------------------------------*/
  764. void EffaceChamp (int arbre, int objet)
  765. {
  766.     Wind *wind;
  767.     WindForm *ptr_dial;
  768.     
  769.     wind = ObjListe(arbre);
  770.     if (wind != WIND_NULL)
  771.     {
  772.         ptr_dial = wind->cont.dialog;
  773.         set_text(ptr_dial->adr_form, objet, "");
  774.         objc_edit(ptr_dial->adr_form, objet, 0, ptr_dial->edit_pos, ED_END, &ptr_dial->edit_pos);
  775.         objc_draw (ptr_dial->adr_form, objet, MAX_DEPTH,
  776.                              ptr_dial->adr_form[objet].ob_x, ptr_dial->adr_form[objet].ob_y,    
  777.                              ptr_dial->adr_form[objet].ob_width, ptr_dial->adr_form[objet].ob_height);
  778.         objc_edit(ptr_dial->adr_form, objet, 0, 0, ED_INIT, &ptr_dial->edit_pos);
  779.     }
  780. }
  781.  
  782. /*-----------------------------------------------------------------------*
  783.  * Gestion des evenements boutons                                        *
  784.  *                                                                       *
  785.  * Derniere modification : 17/05/1996                                    *
  786.  *-----------------------------------------------------------------------*/
  787. static void gere_boutons(void)
  788. {
  789.     register int i, j;
  790.     int top, obflags, obstate, dummy, edit;
  791.     Wind *wind;
  792.     WindForm *ptr_dial;
  793.  
  794.     if (wind_find (Sys->mousex, Sys->mousey))
  795.     {    /* Chercher fenêtre de 1er plan */
  796.         wind_get (ZERO, WF_TOP, &top, &dummy, &dummy, &dummy);
  797.         wind = TopListe(top);
  798.  
  799.         if (wind != WIND_NULL)
  800.             CurWindow = wind->numObj;
  801.  
  802.         if (wind != WIND_NULL && wind->type == WTYPFORM && NOT wind->iconified)
  803.         {
  804.             ptr_dial = wind->cont.dialog;
  805.             Sys->AdrObjet = ptr_dial->adr_form;
  806.         }
  807.         if (wind != WIND_NULL && NOT wind->iconified)
  808.         {
  809.             if (wind->adr_wmenu != (OBJECT *)NULL)
  810.             { /* a-t'on cliqué sur le menu en fenêtre */
  811.             Sys->objet = objc_find (wind->adr_wmenu, BARTITLE, MAX_DEPTH, Sys->mousex, Sys->mousey);
  812.                if (wind->adr_wmenu[Sys->objet].ob_type == G_TITLE)  /* Si clic sur un titre */
  813.                 {
  814.                     menu_wind (wind, Sys->objet);   /* On gère le menu en fenêtre */
  815.                     return;
  816.                 }
  817.             }
  818.             if (wind->adr_wtoolbar != (OBJECT *)NULL)
  819.             { /* a-t'on cliqué sur la ToolBar */
  820.             Sys->objet = objc_find (wind->adr_wtoolbar, ROOT, MAX_DEPTH, Sys->mousex, Sys->mousey);
  821.                if (Sys->objet > 0)  /* Si clic sur un objet du toolbar */
  822.                 {
  823.                     objc_change(wind->adr_wtoolbar, Sys->objet, 0, wind->Xpos, wind->Ypos, wind->Wpos, wind->Hpos, 1, TRUE);
  824.                     (*wind->wtoolbar)(Sys->objet);
  825.                     return;
  826.                 }
  827.             }
  828.             if (wind->type == WTYPUSER)
  829.                 WindUserDo (wind, MU_BUTTON);
  830.  
  831.             if (wind->type != WTYPFORM)
  832.                 return;
  833.         }
  834.     }
  835.     else
  836.         Sys->AdrObjet = AdrDesk;
  837.  
  838.     Sys->objet = objc_find (Sys->AdrObjet, ROOT, MAX_DEPTH, Sys->mousex, Sys->mousey); 
  839.  
  840.     if (Sys->objet)                                                 /* Si on a cliqué sur un objet */
  841.     {
  842.         obflags = (Sys->AdrObjet)[Sys->objet].ob_flags;
  843.         obstate = (Sys->AdrObjet)[Sys->objet].ob_state;
  844.  
  845.         if (NOT (obstate & DISABLED))             /* Si l'objet n'est pas désactivé */
  846.         {
  847.             int popup;
  848.  
  849.             if (obflags & EDITABLE)
  850.             { /* Desactiver curseur */
  851.            objc_edit (Sys->AdrObjet, ptr_dial->edit_objc, 0, ptr_dial->edit_pos, EDEND, &(ptr_dial->edit_pos));
  852.                 /* Reactiver curseur */
  853.                objc_edit (Sys->AdrObjet, Sys->objet, 0, Sys->pos, EDINIT, &(Sys->pos));
  854.  
  855.                 if (Sys->AdrObjet != AdrDesk)
  856.                 {
  857.                     ptr_dial->edit_objc    = Sys->objet;
  858.                     ptr_dial->edit_pos    = Sys->pos;
  859.                 }
  860.             }
  861.  
  862.             if ((obflags & SELECTABLE) &&    (NOT (obflags & RBUTTON)))
  863.             {    /* Si sélectable simple, inverser l'etat de l'objet */
  864.                     (Sys->AdrObjet)[Sys->objet].ob_state ^= SELECTED; 
  865.  
  866.                     objc_draw (Sys->AdrObjet, Sys->objet, MAX_DEPTH, 
  867.                                       (Sys->AdrObjet)->ob_x, (Sys->AdrObjet)->ob_y,
  868.                                         (Sys->AdrObjet)->ob_width, (Sys->AdrObjet)->ob_height);
  869.  
  870.                     evnt_timer(100,0);
  871.                 /* Appel à la fonction de gestion de la boite de dialogue */
  872.                 if (obflags & TOUCHEXIT || obflags & EXIT)
  873.                     (*ptr_dial->fonct)(MU_BUTTON);
  874.             }
  875.             else
  876.             {
  877.                 if (NOT (obflags & TOUCHEXIT))     /* Si ce n'est pas un TOUCHEXIT */
  878.                 {
  879.                     while (Sys->mousek)                     /* Attendre bouton souris relaché */
  880.                         graf_mkstate (&dummy, &dummy, &(Sys->mousek), &dummy);
  881.                 }
  882.             }
  883.  
  884.             if ((obflags & SELECTABLE) &&    (obflags & RBUTTON) && (NOT (obstate & SELECTED)))
  885.             {    /* Si radio-bouton */
  886.                 j = Sys->objet;
  887.                 (Sys->AdrObjet)[Sys->objet].ob_state |= SELECTED;
  888.     
  889.                 objc_draw (Sys->AdrObjet, Sys->objet, MAX_DEPTH,
  890.                                     (Sys->AdrObjet)->ob_x, (Sys->AdrObjet)->ob_y, 
  891.                                     (Sys->AdrObjet)->ob_width, (Sys->AdrObjet)->ob_height);
  892.  
  893.                 i = parent (Sys->AdrObjet, j);             /* Chercher le père       */
  894.                 j = (Sys->AdrObjet)[i].ob_head;          /* Partir du 1° enfant... */
  895.                 i = (Sys->AdrObjet)[i].ob_tail;          /* jusqu'au dernier.      */
  896.                 do
  897.                 {
  898.                     if (((Sys->AdrObjet)[j].ob_flags & RBUTTON) && (j != Sys->objet) &&
  899.                             ((Sys->AdrObjet)[j].ob_state & SELECTED))
  900.                     { /* Les mettre en normal si RBUTTON sauf l'objet cliqué. */
  901.                         (Sys->AdrObjet)[j].ob_state &= ~SELECTED;
  902.     
  903.                         objc_draw (Sys->AdrObjet, j, MAX_DEPTH, 
  904.                                             (Sys->AdrObjet)->ob_x, (Sys->AdrObjet)->ob_y,
  905.                                             (Sys->AdrObjet)->ob_width, (Sys->AdrObjet)->ob_height);
  906.                     }
  907.                     j = (Sys->AdrObjet)[j].ob_next;                 /* Au suivant...     */
  908.                 } while ((j <= i) && (j > (Sys->AdrObjet)[i].ob_next));
  909.             }
  910.             if (popup = IsPopup(wind, Sys->objet))
  911.             {
  912.                 if (Sys->mousex < (Sys->AdrObjet[Sys->objet]).ob_x + (Sys->AdrObjet[ROOT]).ob_x + (Sys->AdrObjet[Sys->objet]).ob_width - 16)
  913.                     pop_up (wind->numObj, Sys->objet, popup);
  914.                 else
  915.                     PopupNextValeur (wind->numObj, Sys->objet, popup);
  916.             }
  917.         }
  918.     }
  919. }
  920.  
  921. /*-----------------------------------------------------------------------*
  922.  * Gestion des evenements clavier                                        *
  923.  *                                                                       *
  924.  * Derniere modification : 17/05/1996                                    *
  925.  *-----------------------------------------------------------------------*/
  926. static void gere_clavier(void)
  927. {
  928.     register int i;
  929.     int evnt = MU_KEYBD;
  930.     char ctr = 0, option[50];
  931.     unsigned char touc;
  932.     int top, dummy;
  933.     Wind *wind;
  934.     WindForm *ptr_dial;
  935.     int cur_pos, cur_objc, dialog = TRUE;
  936.  
  937.     /* On regarde s'il ne s'agit pas d'un evenement special */
  938.     EvntSpe (&evnt);
  939.  
  940.     /* Recupere  l'etat des touches speciales */
  941.     Sys->kbd = (int)Kbshift (BLANK);
  942.     /* Annuler bit CapsLock           */
  943.     Sys->kbd &= ~0x10;                                      
  944.     if ((Sys->kbd == K_RSHIFT) || (Sys->kbd == K_LSHIFT))
  945.         ctr = 0x01;                                      /* Car. représentant la touche spéciale */
  946.     else if (Sys->kbd == K_CTRL)
  947.         ctr = 0x05E;
  948.     else if (Sys->kbd == K_ALT)
  949.         ctr = 0x07;
  950.     else
  951.         ctr = ZERO;
  952.  
  953.     wind_get (ZERO, WF_TOP, &top, &dummy, &dummy, &dummy);
  954.     wind = TopListe(top);
  955.      if (wind != WIND_NULL)
  956.     {
  957.         CurWindow = wind->numObj;
  958.  
  959.         /* Si fenetre iconifiee, on oublie l'evenement */
  960.         if (wind->iconified)
  961.             return;
  962.  
  963.         /* Traitement des événements spéciaux */
  964.         if (evnt != MU_KEYBD)
  965.         {
  966.             switch (wind->type)
  967.             {
  968.                 case WTYPTEXT :
  969.                     WindTextDo(wind, evnt);
  970.                     break;
  971.                 case WTYPUSER :
  972.                     WindUserDo (wind, evnt);
  973.                     break;
  974.             }
  975.             if (wind->type != WTYPFORM)
  976.                 return;
  977.         }
  978.         if (wind->type == WTYPFORM)
  979.         {
  980.             ptr_dial            = wind->cont.dialog;
  981.             Sys->AdrObjet = ptr_dial->adr_form;
  982.             Sys->objet        = ptr_dial->edit_objc;
  983.             Sys->new_objc    = Sys->objet;
  984.             Sys->pos            = ptr_dial->edit_pos;
  985.             Sys->new_pos    = Sys->pos;
  986.         }
  987.         else if (wind->type == WTYPUSER)
  988.         {    /* Envoi touche spéciale et code SCAN + ASCII */
  989.             WindUserDo (wind, evnt);
  990.             return;
  991.         }
  992.         else    
  993.             return;
  994.     }
  995.     else
  996.     {
  997.         stdkey (&touc);                                         /* Recherche code Ascii        */
  998.         i = ZERO;
  999.         do                                                                    /* Pour chaque objet du menu   */
  1000.         {
  1001.             if (AdrMenu[i].ob_type == G_STRING)                /* Si c'est une option */
  1002.             {
  1003.                 strcpy (option, AdrMenu[i].ob_spec.free_string);        /* La lire */
  1004.                 trim (option);                                                        /* Virer les espaces */
  1005.                 if ((*(option + strlen (option) - 1) == touc) && (*(option + strlen (option) - 2) == ctr))
  1006.                 { /* Si le caractere et la touche speciale correspondent */
  1007.                     if (NOT (AdrMenu[i].ob_state & DISABLED))             /* Si actif */
  1008.                     {    /* Generer message de selection d'une option du menu */
  1009.                         EnvoiMessage(MN_SELECTED, m_title(AdrMenu, i), i);
  1010.                     }
  1011.                 }
  1012.             }
  1013.         } while (NOT (AdrMenu[i++].ob_flags & LASTOB));
  1014.         return;
  1015.     }
  1016.  
  1017.     if ((Sys->key == RETURN) || (Sys->key == ENTER)) 
  1018.     {    /* Si <Return> ou <Enter>, chercher bouton DEFAULT s'il y en a */
  1019.         i = ZERO;
  1020.         do
  1021.         {
  1022.             if (Sys->AdrObjet[i].ob_flags & DEFAULT)
  1023.             {
  1024.                 form_button(Sys->AdrObjet, i, 1, &(Sys->new_objc));
  1025.                 evnt_timer(100,0);
  1026.                 Sys->objet = i;
  1027.                 (*ptr_dial->fonct)(MU_BUTTON);
  1028.                 return;
  1029.             }
  1030.         } while (NOT (Sys->AdrObjet[i++].ob_flags & LASTOB)); 
  1031.     }
  1032.  
  1033.     /* Interprete et traite l'evenement clavier */
  1034.     dialog = do_keybd(Sys->AdrObjet, Sys->objet);
  1035.     if (Sys->key)
  1036.     {
  1037.         objc_edit(Sys->AdrObjet, Sys->objet, Sys->key, Sys->pos, EDCHAR, &Sys->pos);
  1038.         Sys->new_objc = Sys->objet;
  1039.         Sys->new_pos = Sys->pos;
  1040.     }
  1041.  
  1042.     /* Repositionner le curseur */
  1043.     if (dialog > 0) 
  1044.     {
  1045.         if (Sys->new_objc > 0 && Sys->new_objc != Sys->objet || Sys->new_pos != Sys->pos)
  1046.         {
  1047.             objc_edit(Sys->AdrObjet, Sys->objet, 0, Sys->pos, EDEND, &Sys->pos);
  1048.             Sys->pos = Sys->new_pos;
  1049.             objc_edit(Sys->AdrObjet, Sys->new_objc, 0, Sys->pos, EDEND, &Sys->pos);
  1050.         }
  1051.  
  1052.         /* On sauve les parametres dans l'objet WindForm */
  1053.         ptr_dial->edit_objc = Sys->new_objc;
  1054.         ptr_dial->edit_pos = Sys->pos;
  1055.     }
  1056.  
  1057.     /* Traiter l'eventuel raccourcis clavier */
  1058.     if (dialog == -1)
  1059.     {
  1060.         (*ptr_dial->fonct)(MU_BUTTON);
  1061.         return;                
  1062.     }
  1063. }
  1064.  
  1065. static void EvntSpe (int *evnt)
  1066. {
  1067.     /* On definit s'il s'agit ou non d'un evenement special */
  1068.  
  1069.   if (Sys->key == HELP)
  1070.         *evnt = EV_HELP;
  1071.     else if (Sys->key == UNDO)
  1072.         *evnt = EV_UNDO;
  1073.     else if (Sys->key == ESC)
  1074.         *evnt = EV_ESC;
  1075.     else if (Sys->key == HOME)
  1076.         *evnt = EV_HOME;
  1077.     else if (Sys->key == SH_HOME)
  1078.         *evnt = EV_SHHOME;
  1079.     else if (Sys->key == ARUP)
  1080.         *evnt = EV_ARUP;
  1081.     else if (Sys->key == ARDN)
  1082.         *evnt = EV_ARDN;
  1083.     else if (Sys->key == ARLF)
  1084.         *evnt = EV_ARLF;
  1085.     else if (Sys->key == ARRT)
  1086.         *evnt = EV_ARRT;
  1087.     else if (Sys->key == SH_ARUP)
  1088.         *evnt = EV_SHARUP;
  1089.     else if (Sys->key == SH_ARDN)
  1090.         *evnt = EV_SHARDN;
  1091.     else if (Sys->key == SH_ARLF)
  1092.         *evnt = EV_SHARLF;
  1093.     else if (Sys->key == SH_ARRT)
  1094.         *evnt = EV_SHARRT;
  1095. }
  1096.  
  1097. /**************************-=< Fin du module >=-**************************/
  1098.